var app = getApp();
Component({
  properties: {
    cart: {
      type: Object,
      value: {}
    }
  },
  data: {
  },
  attached: function () {
  },
  methods: {
    shopCart: function () {
      if (this.data.cart.cartList.length) {
        this.setData({
          'cart.iShidden': !this.data.cart.iShidden
        })
      }
    },
    shopCartClose:function(){
      this.setData({
        'cart.iShidden': !this.data.cart.iShidden
      })
    },
    reduce: function (e) {
      var index = e.currentTarget.dataset.index;
      this.triggerEvent("reduce", index);
    },
    plus: function (e) {
      var index = e.currentTarget.dataset.index;
      this.triggerEvent("plus", index);
    },
    delGood: function () {
      this.triggerEvent("delGood");
    },
    settlement: function (e) {
      var formId = e.detail.formId;
      this.triggerEvent("settlement", formId);
    }
  }
})